package com.atguigu.tingshu.search.api;


import com.atguigu.tingshu.common.conn.GuiGuLogin;
import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.search.service.ItemService;
import com.atguigu.tingshu.vo.album.AlbumInfoDetailVo;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "专辑详情管理")
@RestController
@RequestMapping("api/search/albumInfo")
@SuppressWarnings({"unchecked", "rawtypes"})
public class itemApiController {

    @Autowired
    private ItemService itemService;


    // /api/search/albumInfo/{albumId}
    //专辑详情
    @GetMapping("/{albumId}")
    @GuiGuLogin(required = false)
    public Result<AlbumInfoDetailVo> getAlbumInfoDetail(@PathVariable Long albumId) {
        AlbumInfoDetailVo albumInfoDetailVo = itemService.getAlbumInfoDetail(albumId);
        return Result.ok(albumInfoDetailVo);
    }

}

